#ifndef GRAPHICS_H
#define GRAPHICS_H

#include <iostream>
#include <string>
#include <d3d9.h>
#include <d3dx9.h>


using namespace std;

struct Image
{
	LPDIRECT3DTEXTURE9 id;
	LPDIRECT3DTEXTURE9 image;
	const char* file;
	int width;
	int height;
};

class Graphics
{
	public:
		Graphics();
		~Graphics();
		void Shutdown();
		bool Initwindow(HINSTANCE hInstance, int nCmdShow, int x, int y, bool windowed);
		void Clear(int r, int g, int b);
		void Cleararea(int r, int g, int b, D3DRECT area);
		void Loadimage(const char* filename);
		void CreateTextures();
		void startDrawing();
		void DrawImage(const char* file, int x, int y, int frame);
		void DrawText(int size, const char* text, int x, int y);
		void stopDrawing();	
		
		LRESULT WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

		const char* check(int i);

	private:
		int windowWidth, windowHeight;
		int r, g, b;
		int images;
		HDC hdc;
			
		DWORD WindowStyle;
		LPDIRECT3D9 d3d;
		LPD3DXFONT font;
		LPDIRECT3DDEVICE9 d3dDevice;
		Image *I[20];	
		LPDIRECT3DTEXTURE9 image;
		LPD3DXSPRITE sprite;
		
	protected:
		HWND appWindow;
};

#endif